package main

import "fmt"

type Human struct {
	name string
	age  int
}

type Student struct {
	Human
	grade string
}

func (h Human) sayHi() {
	fmt.Println("Human-name", h.name)
}

func (h Human) Sing(song string) {
	fmt.Println("sing", song)
}

// 重载Human的sayHi方法
func (s Student) sayHi() {
	fmt.Println("Student's name", s.name)
}

func (s Student) sing(song string) {
	fmt.Println("Student is singing", song)
}

type Men interface {
	sayHi()
	sing(song string)
}

func main() {
	person1 := Student{Human{"Mike", 12}, "4"}
	// person2 := Student{Human{"Mary", 17}, "9"}

	// 定义
	var i Men
	i = person1
	i.sayHi()
	i.sing("第一首歌")

	// 定义三个变量
	x := make([]Men, 3)
	fmt.Println("x", x)
}
